<?php
	//获取数据
	$num = empty($_POST['num'])?'':$_POST['num'];
	//var_dump($num);
	
	function create($num,$path) {
		$data = '<!DOCTYPE html>
<html lang="cn">
	<head>
		<meta charset="UTF-8">
		<title>JQ</title>
		<script src="./jquery-1.8.3.min.js"></script>
	</head>
	<body>
	    <h1></h1>
		<hr>			
	</body>
</html>';
		for ($i=1; $i<=$num; $i++) {
			$file = "./{$i}.1{$path}";
		    //var_dump($file);
		    file_put_contents($file, $data);
		}
		for ($j=1; $j<=$num; $j++) {
			$file2 = "./{$j}.2{$path}";
		    //var_dump($file2);
		    file_put_contents($file2, $data);
		}					
	}	
	create($num, '.html');	
?>

<!DOCTYPE html>
<html lang="cn">
	<head>
		<meta charset="UTF-8">
		<title>创建文件</title>
	</head>
	<body>
	    <form action="" method="post">
	    	<input type="text" name="num" value="" />
	    	<input type="submit" value="创建"/>
	    </form>				
	</body>
</html>
